# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=librsvg
pkgver=2.40.19
pkgrel=1
epoch=2
pkgdesc="SVG rendering library"
url="https://wiki.gnome.org/Projects/LibRsvg"
arch=(i686 x86_64)
license=(LGPL)
depends=(gdk-pixbuf2 pango libcroco)
makedepends=(intltool gobject-introspection vala python2 gtk-doc git)
_commit=0359a8825e0db9c91d0335b0394f3ef70771d48f  # tags/2.40.19^0
source=("git+https://git.gnome.org/browse/librsvg#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --disable-static --enable-vala --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0 /g' libtool
  make
}

check() {
  cd $pkgname
  # Reftests fail due to differences in text rendering
  # Even with the fixated font on master there are still differences on i686
  make check || :
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
